<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>立体旋转</title>
    <style>
        .cube{
            position: relative;
            width: 200px;
            height: 200px;
            margin: 100px auto 0;
            transition: all 2s;
            /* 3d呈现 3d视觉效果 */
            transform-style: preserve-3d;
        }
        .cube div{
            position: absolute;
            left: 0;
            top: 0;
            width: 200px;
            height: 200px;
        }
        .font{
            background-color: orange;
            transform: translatez(100px);
        }
        .back{
            background-color: aqua;
            transform: translatez(-100px);
        }
        .cube:hover{
            transform: rotatey(180deg);
        }
    </style>
</head>
<body>
    <div class="cube">
        <div class="font">前面</div>
        <div class="back">后面</div>
    </div>
</body>
</html>